<?php

namespace App\Http\Controllers\Stats;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Resources\Common\DataResource;
use App\Services\Stats\Summary\Elasticsearch\PlayerBetService;
use App\Services\Stats\Summary\Elasticsearch\PlayerGainService;
use App\Services\Stats\Summary\Elasticsearch\PlayerCountService;
use App\Services\Stats\Summary\Elasticsearch\DocCountService;

class SummaryController extends Controller
{

    /**
     * 获取统计数据【PlayerBet】
     */
    public function topPlayerBet(Request $request)
    {
        $data = PlayerBetService::create()->getTopList($request);

        return DataResource::make($data);
    }

    /**
     * 获取统计数据【PlayerGain】
     */
    public function topPlayerGain(Request $request)
    {
        $data = PlayerGainService::create()->getTopList($request);

        return DataResource::make($data);
    }

    /**
     * 获取统计数据【PlayerCount】
     */
    public function topPlayerCount(Request $request)
    {
        $data = PlayerCountService::create()->getTopList($request);

        return DataResource::make($data);
    }

    /**
     * 获取统计数据【DocCount】
     */
    public function topDocCount(Request $request)
    {
        $data = DocCountService::create()->getTopList($request);

        return DataResource::make($data);
    }
}
